﻿@inherits Vowei.Web.G18nWebViewPage<IEnumerable<IGrouping<bool, Vowei.Core.Models.Project>>>
@using System.Web.Mvc.Html 
@using Vowei.Web.Helpers;

@{
    ViewBag.Title = T("项目列表");
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@T("我的项目")</h2>

@foreach (var group in Model)
{
    <h3>@if (!group.Key) { Write(T("正在进行的项目")); } else { Write(T("已经关闭的项目")); } </h3>
    <ul class="project-list">
    @foreach (var item in group.OrderBy(p => p.StartDate))
    {
        <li title="@item.ID">
            <div class="display-field">
            <h4><a href="/Project/Details/@item.ID">@item.Title</a></h4>
            </div>

            <div class="display-label">@T("项目开始日期")</div>
            <div class="display-field">@T(item.StartDate)</div>
        
            <div class="display-label">@T("项目最后期限")</div>
            @if (item.DueDate.HasValue)
            {
                <div class="display-field">@T(item.DueDate)</div>
            }
            else
            {
                <div class="display-field">@T("项目是永久项目")</div>
            }

            <div class="display-label">@T("负责人：")</div>
            <div class="display-field">@item.Owner</div>
            
            <div class="display-label">
                <p>
                  <a href="/Project/Timeline/@item.ID">@T("项目进展")</a> |
                  <a href="/Requirement/Index/?pid=@item.ID">@T("需求列表")</a> |
                  <a href="/Account/ImportUsers/?pid=@item.ID">@T("从Excel导入团队成员")</a> |
                  @Html.ActionLink(T("导入任务"), "ImportProjectTasks", "Wizard", new { id = item.ID }, null)
                </p>
                <p>
                  <a href="/Statistics/RequirementWorks/?pid=@item.ID">@T("需求工作量统计")</a> |
                  <a href="/Statistics/EarnedValue/?pid=@item.ID">@T("挣值分析")</a>
                </p>
            </div>
            <hr />
        </li>
    }
    </ul>
}
